<%@ page language="java" pageEncoding="UTF-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<html>
<head>
<meta charset="UTF-8">
<title>Admin</title>
<!-- 引入css样式文件 -->
	<!-- Bootstrap Core CSS -->
	<link href="<%=basePath%>css/bootstrap.min.css" rel="stylesheet" />
	<!-- MetisMenu CSS -->
	<link href="<%=basePath%>css/metisMenu.min.css" rel="stylesheet" />
	<!-- DataTables CSS -->
	<link href="<%=basePath%>css/dataTables.bootstrap.css" rel="stylesheet" />
	<!-- Custom CSS -->
	<link href="<%=basePath%>css/sb-admin-2.css" rel="stylesheet" />
	<!-- Custom Fonts -->
	<link href="<%=basePath%>css/font-awesome.min.css" rel="stylesheet" type="text/css" />
	<link href="<%=basePath%>css/admin.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="wrapper">
	<!-- 导航栏部分 -->
	<nav class="navbar navbar-default navbar-static-top" role="navigation"
		 style="margin-bottom: 0">
		<div class="navbar-header">
			<a class="navbar-brand" href=#>yun盘管理员系统 </a>
		</div>
		<ul class="nav navbar-top-links navbar-right">
			<li>
				<a class="logout" href="${pageContext.request.contextPath }/admin/adminLogin.action">
					<i class="fa fa-sign-out fa-fw"></i>退出登录
				</a>
			</li>
		</ul>
	</nav>
</div>
<div class="search" style="padding-left: 275px;">
	<form action="${pageContext.request.contextPath}/admin/adminList.action" class="form-inline" method="post">
		<div class="form-group">
			<label style="margin-left:100px">用户名称:</label>
			<input name="username" type="text" style="margin-left:10px"/>
			<button type="submit" class="btn btn-primary" style="margin-left:100px">查询</button>
		</div>
	</form>
</div>
<div class="row">
	<div class="col-lg-12">
		<div class="panel-heading">客户信息列表</div>
		<table class="table table-bordered table-striped">
			<thead>
				<tr>
					<th>编号</th>
					<th>用户名</th>
					<th>已用内存</th>
					<th>总共内存</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
			<c:forEach items="${ulist}" var="item">
				<tr>
					<td>${item.id}</td>
					<td>${item.username}</td>
					<td>${item.countSize}</td>
					<td>${item.totalSize}</td>
					<td>
						<a href="${pageContext.request.contextPath}/admin/deleteUser.action?username=${item.username}"
						   class="btn btn-danger btn-xs">删除</a>
					</td>
				</tr>
			</c:forEach>
			</tbody> 
		</table>
	</div>
</div>
<script type="text/javascript">

//删除客户
/* function deleteuser(username) {
    if(confirm('确实要删除该客户吗?')) {
    	var user = new FormData();
    	user.append("username", username);
    	$.ajax({
    	    url: 'admin/deleteuser.action',
    	    type: 'POST',
    	    cache: false,
    	    //这个参数是jquery特有的，不进行序列化，因为我们不是json格式的字符串，而是要传文件
    	    processData: false,
    	    //注意这里一定要设置contentType:false，不然会默认为传的是字符串，这样文件就传不过去了
    	    contentType: false,
    	    data: user,
    	    success: function (data) {
	            if(data =="OK"){
	                alert("客户删除成功！");
	                window.location.reload();
	            }else{
	                alert("删除客户失败！");
	                window.location.reload();
	            }
    	    }
    	});
    }
} */
</script>
</body>
</html>